package com.sea.data.service;



import com.sea.data.entity.Order;
import com.sea.data.entity.SalesForecast;
import org.apache.ibatis.annotations.Param;

import java.io.InputStream;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 * @author 陈鸿飞
 */
public interface SalesForecastService {
    /**
     * 新增
     * @param salesForecast
     * @return
     */
    Integer save(SalesForecast salesForecast);
    /**
     * 查询指定
     * @param salesForecast
     * @return
     */
    List<SalesForecast> findByCnd(SalesForecast salesForecast);
    /**
     * 导入SKU
     * @param inputStream
     * @param fileName
     * @return
     * @throws Exception
     */
    void importSku(InputStream inputStream, String fileName, String userRealName) throws Exception;
    /**
     * 导入SKU库存
     * @param inputStream
     * @param fileName
     * @return
     * @throws Exception
     */
    void importSkuStock(InputStream inputStream, String fileName, String salesChannelName,String salesDate) throws Exception;
    /**
     * 查询指定
     * @param salesForecast
     * @return
     */
    SalesForecast findBySkuDateChannel(SalesForecast salesForecast);
    /**
     * 更新
     * @param salesForecast
     * @return
     */
    Integer usave(SalesForecast salesForecast);
    /**
     * 获取Listing分组
     * @return
     */
    List<SalesForecast> groupByListing();
    /**
     * 获取日期分组
     * @return
     */
    List<SalesForecast> groupBySalesDate();
    /**
     * 获取月份分组
     * @return
     */
    List<SalesForecast> groupBySalesMonth();

    Double findBySalesNumber(String beginDate,
                             String endDate,
                             String salesListing);

    Integer findByProduceNumber(String beginDate,
                                String endDate,
                                String salesListing);

    Integer findByPhysicalNumber(String beginDate,
                                 String endDate,
                                 String salesListing);

    void getSalesProduceNumber(String salesChannelName,String salesSku) throws ParseException;

    void getSalesPhysicalNumber(String salesDate,String salesChannelName,String salesSku) throws ParseException;

    /**
     * 海外仓在产数据
     * @throws ParseException
     */
    void getSalesStockProduceNumber(String salesChannelName,String salesSku) throws ParseException;
    /**
     * 海外仓海运数据
     * @throws ParseException
     */
    void getSalesStockPhysicalNumber(String salesChannelName,String salesSku) throws ParseException;

    /**
     * 国内仓入库数据
     * @param salesChannelName
     * @throws Exception
     */
    void getWareProduceNumber(String salesChannelName,String salesDate,String salesSku) throws Exception;

    List<SalesForecast> findBySalesDate();
    /**
     * 查找基础数据
     * @return
     */
    List<Map<String,Object>> findReportByListingAsin(List<String> list,List<String> mList);

    List<SalesForecast> findSellNumber(SalesForecast salesForecast);
    /**
     * 数据重置
     * @return
     */
    Integer resetStock();

    /**
     * 数据重置
     * @return
     */
    Integer resetSalesForecast();

}
